package cate.game.role.res.magiccontract.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBMagicContract;
import cate.game.role.res.magiccontract.RoleMagicContract;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "英雄下灵契台 の 请求")
public class HeroOffDeskReq implements MsgInput {
    @NoteField("阵营")
    public int camp;
    @NoteField("位置")
    public int pos;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<RoleMagicContract> r = cc.getRole().getRes().magicContract.offHero(camp, pos);
        if (r.ok()) {
            r.data.noticeUpdate();
        } else {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBMagicContract.HERO_OFF_REQ;
    }
}
